<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="org.apache.struts.Globals" var="LOCALE_KEY" scope="page" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="SWITCH_LOCALE_LINKS_COLLECTION_KEY" scope="page" />

<div id="switchLocaleForm">
	<div class="switchLocaleFormTitle"><atleap:message key="core.contentLocale.form.language" /></div>
	<c:set var="currentLanguage" value="${sessionScope[pageScope.LOCALE_KEY].language}" />
		<atleap:iterator items="${requestScope[pageScope.SWITCH_LOCALE_LINKS_COLLECTION_KEY]}" var="entry">
			<c:set var="locale" value="${entry.key}" />
			<c:set var="language" value="${locale.identifier}" />
			<atleap:fieldValue valueMap="${locale.title}" var="title" />
			<div class="switchLocaleFormItem">
				<c:choose>
					<c:when test="${currentLanguage != language}">
						<a href="${entry.value}" title="${title}">${title}</a>
					</c:when>
					<c:otherwise>
						<b>${title}</b>
					</c:otherwise>
				</c:choose>
			</div>
		</atleap:iterator>
</div>

